package com.project.junM.service.impl;

import com.project.junM.entity.TMember;
import com.project.junM.entity.TOrder;
import com.project.junM.mapper.TOrderMapper;
import com.project.junM.service.TOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;

@Service
public class TOrderServiceImpl implements TOrderService {

    @Autowired
    private TOrderMapper tOrderMapper;

    @Override
    public int insertSelective(TOrder record) {
        return tOrderMapper.insertSelective(record);
    }

    @Override
    public boolean selectByMemberId(HttpSession session) {
        TMember user = (TMember)session.getAttribute("user");
        TOrder tOrder = tOrderMapper.selectByMemberId(user.getId());
        boolean flag=tOrder!=null?true:false;

        return flag;
    }


}
